var e = require;
var t = module;
var n = exports;
var o,
    i =
        (this && this.__extends) ||
        ((o = function (e, t) {
            return (o =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                })(e, t);
        }),
        function (e, t) {
            function n() {
                this.constructor = e;
            }
            o(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
        }),
    r =
        (this && this.__decorate) ||
        function (e, t, n, o) {
            var i,
                r = arguments.length,
                a = r < 3 ? t : null === o ? (o = Object.getOwnPropertyDescriptor(t, n)) : o;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, n, o);
            else
                for (var s = e.length - 1; 0 <= s; s--)
                    (i = e[s]) && (a = (r < 3 ? i(a) : 3 < r ? i(t, n, a) : i(t, n)) || a);
            return 3 < r && a && Object.defineProperty(t, n, a), a;
        };
Object.defineProperty(n, "__esModule", {value: !0});
var a,
    s = e("index"),
    c = e("events"),
    l = e("sound"),
    u = e("user-data"),
    p = e("base-panel"),
    h = e("gold-node"),
    d = e("player-info"),
    f = e("player-war"),
    t = cc._decorator,
    e = t.ccclass,
    t = t.property,
    e =
        ((a = p.default),
        i(m, a),
        (m.prototype.init = function () {}),
        (m.prototype.start = function () {
            var e = d.playerInfo.getLimitMaxGold(),
                t = d.playerInfo.getGold(),
                n = d.playerInfo.getRewardGold();
            this.goldNode.setGold(t + (n = e < t + n ? e - t : n)),
                (this.rewardGold.string = n.toString() + "金币"),
                d.playerInfo.setGold(t + n),
                s.platform.trackEvent("get_coin", {number: n, coin: t + n}),
                l.sound.play(l.Sound.WIN);
        }),
        (m.prototype.hideThis = function () {
            this.hide();
        }),
        (m.prototype.share = function () {
            var e = f.playerWar.getWarLevel();
            s.platform.shareVideoRecord(e, "", "coin sort", "main");
        }),
        (m.prototype.main = function () {
            u.userData.saveLocalData(),
                cc.director.loadScene("main", function () {
                    c.operEvent.clear();
                });
        }),
        (m.prototype.continue = function () {
            d.playerInfo.restartData(),
                c.operEvent.emit({action: c.default.restartCellLayer, data: {cellDelayTime: 0}}),
                this.hide();
        }),
        r([t(h.default)], m.prototype, "goldNode", void 0),
        r([t(cc.Label)], m.prototype, "rewardGold", void 0),
        r([e], m));
function m() {
    var e = (null !== a && a.apply(this, arguments)) || this;
    return (e.goldNode = null), (e.rewardGold = null), e;
}
n.default = e;
